home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / psion / sound.fmt < prev    next >
Text File  |  1995-03-31  |  2KB  |  42 lines

  1. PSIONICS FILE - SOUND.FMT
  2. =========================
  3. Format of Sound files
  4. Last modified 1994-04-22
  5. ========================
  6.  
  7. Sound files hold recorded sounds, and can only be used by the Series 3a. The
  8. sound is played at 8000 entries per second. The file uses A-Law encoding.
  9.  
  10. A sound file begins with a 32 byte header of the following form:
  11.   Offset  0 (cstr): "ALawSoundFile**"
  12.   Offset 16 (word): format version number
  13.   Offset 18 (long): number of samples in the file
  14.   Offset 22 (word): length of silence (in 1/32 seconds) to append on playback
  15.   Offset 24 (word): number of times to repeat on playback (0 and 1 both mean
  16.                     play once)
  17.  
  18. The rest of the file is sound samples. Each byte is a value encoded using
  19. A-Law to represent 13 bit values. The most significant bit is the sign, and
  20. the other 7 bits represent a 12 bit amplitude (note that this is a sign-and-
  21. magnitude representation, not a twos-complement one):
  22.  
  23.     S000XXXX -> S0000000XXXX1
  24.     S001XXXX -> S0000001XXXX1
  25.     S010XXXX -> S000001XXXX10
  26.     S011XXXX -> S00001XXXX100
  27.     S100XXXX -> S0001XXXX1000
  28.     S101XXXX -> S001XXXX10000
  29.     S110XXXX -> S01XXXX100000
  30.     S111XXXX -> S1XXXX1000000
  31.  
  32. When encoding values, the bits marked i are ignored:
  33.  
  34.     S000XXXX <- S0000000XXXXi
  35.     S001XXXX <- S0000001XXXXi
  36.     S010XXXX <- S000001XXXXii
  37.     S011XXXX <- S00001XXXXiii
  38.     S100XXXX <- S0001XXXXiiii
  39.     S101XXXX <- S001XXXXiiiii
  40.     S110XXXX <- S01XXXXiiiiii
  41.     S111XXXX <- S1XXXXiiiiiii
  42.